package com.ruoyi.psi.purchase.order.mapper;



import com.ruoyi.psi.purchase.order.domain.PurchaseOrder;
import com.ruoyi.psi.purchase.order.domain.PurchaseOrderList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 采购订单
 * 数据层
 * @author Drj 2021/6/28
 */
public interface PurchaseOrderMapper {
    /**
     * 采购订单查询
     * @param purchaseOrder
     * @return
     */
    public List<PurchaseOrder> selectPurchaseOrderList(PurchaseOrder purchaseOrder);

    /**
     * 按编号查询
     * @param purchaseOrderId 采购订单编号
     * @return
     */
    public PurchaseOrder selectPurchaseOrderById(String purchaseOrderId);

    /**
     * 获取最新的采购订单编号
     * @return
     */
    public String getPurchaseOrderId();

    /**
     * 采购订单新增
     * @param purchaseOrder
     * @return
     */
    public int insertPurchaseOrder(PurchaseOrder purchaseOrder);

    /**
     * 采购订单更新
     * @param purchaseOrder
     * @return
     */
    public int updatePurchaseOrder(PurchaseOrder purchaseOrder);

    /**
     * 更新采购订单删除标志位
     * @param purchaseOrder
     * @return
     */
    public int updatePurchaseOrderDeleteFlag(PurchaseOrder purchaseOrder);

    /**
     * 更新审批状态
     * @param purchaseOrderId
     * @return
     */
    int completeApprovalFlag(String purchaseOrderId);

    /**
     * 拒绝审批状态
     * @param purchaseOrderId
     * @return
     */
    int refuseApprovalFlag(String purchaseOrderId);

    /**
     * 改变订单付款状态
     * @param purchaseOrderId
     * @return
     */
    int updatePaymentStatus(String purchaseOrderId);

    /**
     * 采购订单详细查询
     * @param purchaseOrderList
     * @return
     */
    public List<PurchaseOrderList> selectPurchaseOrderListList(PurchaseOrderList purchaseOrderList);

    /**
     * 查询采购订单对应的所有产品详细
     * @param purchaseOrderId 采购订单编号
     * @return
     */
    public List<PurchaseOrderList>  selectPurchaseOrderListListById(String purchaseOrderId);

    /**
     * 查询采购订单对应的指定产品详细
     * @param purchaseOrderId
     * @return
     */
    public PurchaseOrderList  selectPurchaseOrderListById(@Param("purchaseOrderId")String purchaseOrderId, @Param("produceId")String produceId);

    /**
     * 采购订单详细新增
     * @param purchaseOrderList
     * @return
     */
    public int insertPurchaseOrderList(PurchaseOrderList purchaseOrderList);

    /**
     * 采购订单详细更新
     * @param purchaseOrderList
     * @return
     */
    public int updatePurchaseOrderList(PurchaseOrderList purchaseOrderList);

    /**
     * 删除采购订单详细
     * @param purchaseOrderId  采购订单编号
     * @param produceId 产品编号
     * @return
     */
    public int deletePurchaseOrderListById(@Param("purchaseOrderId")String purchaseOrderId, @Param("produceId")String produceId);

    /**
     * 查询所有未入库的采购订单
     * @param purchaseOrder
     * @return
     */
    List<PurchaseOrder> selectAllNotStoragePurchaseOrderList(PurchaseOrder purchaseOrder);

    /**
     * 查询某未入库采购订单的详情信息
     * @param purchaseOrderId
     * @return
     */
    List<PurchaseOrderList> selectNotStoragePurchaseOrderById(String purchaseOrderId);

    /**
     * 查询某未质检的采购订单的详情信息
     * @param purchaseOrderId
     * @return
     */
    List<PurchaseOrderList> selectNotInspectPurchaseOrderById(String purchaseOrderId);
}
